let glueType = {
    "java": "GLUE_GROOVY",
    "shell": "GLUE_SHELL",
    "python": "GLUE_PYTHON",
    "php": "GLUE_PHP",
    "nodejs": "GLUE_NODEJS",
    "powershell": "GLUE_POWERSHELL",
    "commandLine": "GLUE_COMMANDLINE",
    "sql": "GLUE_SQL",
    "etl": "GLUE_ETL",
    "workflow": "GLUE_WORKFLOW"
}

export let admin = { name: 'admin', role: 'SuperAdmin' }

export function getGlueType(glue) {
    return glueType[glue] || "BEAN";
}

export const publicKey = ref(localStorage.getItem("rsaPublicKey"))

export const production = import.meta.env.MODE === 'production'
export const apiPrefix = production ? "https://api.dansj.cn" : "http://localhost:8888/api"
const baseUrl = production ? 'https://dmp.dansj.cn' : 'http://localhost:8888'
export const dmpPageUrl = production ? "https://dansj.cn" : "http://localhost:9999"

export const permission = { Read: 1, Write: 1 << 1, Update: 1 << 2, Delete: 1 << 3, Execute: 1 << 4 }

export const getPermission = (permissionVal) => {
    return permission[Object.keys(permission).find(key => key.toLowerCase() === permissionVal.toLowerCase())]
}

export { baseUrl }